package cn.yr.blog.service.impl;

import cn.hutool.core.util.RandomUtil;
import cn.yr.blog.mapper.TagMapper;
import cn.yr.blog.service.TagService;
import cn.yr.common.core.domain.entity.YrTag;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * (YrTag)表服务实现类
 *
 * @author makejava
 * @since 2020-03-11 19:54:41
 */
@Service("tagService")
public class TagServiceImpl extends ServiceImpl<TagMapper, YrTag> implements TagService {

    /**
     * @description 设置Tag随机颜色
     * @author Lang
     * @date 2020/8/9 14:59
     */
    @Override
    public String getRandomTagColor(){
        String[] randomColors = {"primary","success","warning","error","#1990be","#8b54d4","#434344"};
        int i = RandomUtil.randomInt(0, randomColors.length - 1);
        return randomColors[i];
    }

}